package com.chendx.store.seckill.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.chendx.model.common.dtos.ResponseResult;
import com.chendx.model.seckill.dto.SeckillOrderDto;
import com.chendx.model.seckill.pojo.SeckillOrder;

/**
 * Created by chendx on 2022/4/22.
 */
public interface SeckillOrderService extends IService<SeckillOrder> {

    /**
     * 添加抢购单
     * @param dto
     * @return
     */
    public ResponseResult add(SeckillOrderDto dto);

    /**
     * 查询抢单状态
     * @return
     */
    public ResponseResult queryStatus();

    /**
     * 加载订单
     * @param dto
     * @return
     */
    ResponseResult loadOrder(SeckillOrderDto dto);

    /**
     * 关闭订单
     * @param username
     */
    void close(String username);

    /**
     * 抢购单支付
     * @return
     */
    public ResponseResult pay();

    /**
     * 取消抢单
     * @return
     */
    ResponseResult cancel();

    /**
     * 查询订单详情
     * @param id
     * @return
     */
    ResponseResult one(String id);
}
